package net.vidmar.tvspored;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class XmlTvData {

	private List<Channel> channels = new ArrayList<Channel>();
	private List<MyDate> dates = new ArrayList<MyDate>();

	public List<Channel> getChannels() {
		return channels;
	}

	public List<MyDate> getDates() {
		return dates;
	}

	public void addChannel(Channel channel) {
		channels.add(channel);
	}

	public Channel getChannel(String id) {
		for (int i = 0; i < channels.size(); i++) {
			if (channels.get(i).Id.equalsIgnoreCase(id))
				return channels.get(i);
		}
		return null;
	}

	public void addDate(Date date) {
		for (MyDate d : dates)
			if (d.Date.equals(date))
				return;
		dates.add(new MyDate(date));
	}

}